<!DOCTYPE HTML>

<html lang="pt-br"  
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
<ui:composition template="/WEB-INF/template/SegurancaTemplate.xhtml">
<ui:define name="corpo">
	<style type="text/css">
	.div-tela 
	{
		max-width: auto;
		padding: 10px 10px 10px;
	    margin: 0 auto 20px;
	    background-color: #fff;
	    border: 1px solid #e5e5e5;
	    -webkit-border-radius: 5px;
	    	-moz-border-radius: 5px;
	        	border-radius: 5px;
	    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
	    	-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
	        	box-shadow: 0 1px 2px rgba(0,0,0,.05);
	}
	.colunaEsquerda
	{  
	    text-align: left;
	    width: 30%;  
	}  
	.colunaDireita
	{  
	    text-align: left;
	    width: 70%;
	}
	.animated .ui-progressbar-value { 
        background-image: /lib/imagem/gif-load.gif; 
    }   
	</style>
<div class="div-tela">
	
	<p:panel header="Processamento de Dados" style="width:100%;height:100%">
	
		<p:commandButton id="btnProcessar"
						widgetVar="processar" 
						value="Processar" 
						styleClass="ui-priority-primary"
						actionListener="#{processamentoDadosManagerBean.processarDados}"
						onclick="PF('pbFuncionario').start();PF('processar').disable();PF('sair').disable();"/>
						
		<p:commandButton id="btnSair"
						widgetVar="sair" 
						value="Sair" 
						styleClass="ui-priority-primary"
						actionListener="#{processamentoDadosManagerBean.sair}"/>
		
		<div>
		<BR />
		</div>

		<h3>Processando Dados dos Funcionários</h3>
		<p:progressBar widgetVar="pbFuncionario"
					ajax="true"
					value="#{processamentoDadosManagerBean.progressoFuncionario}"
					labelTemplate="{value}%">
			<p:ajax event="complete" 
					oncomplete="PF('pbCliente').start();"/>
		</p:progressBar>
		
		<h3>Processando Dados dos Clientes</h3>
		<p:progressBar widgetVar="pbCliente"
					ajax="true"
					value="#{processamentoDadosManagerBean.progressoCliente}"
					labelTemplate="{value}%">
			<p:ajax event="complete"
					oncomplete="PF('pbFabricante').start();"/>
		</p:progressBar>
		
		<h3>Processando Dados dos Fabricantes</h3>
		<p:progressBar widgetVar="pbFabricante"
					ajax="true"
					value="#{processamentoDadosManagerBean.progressoFabricante}"
					labelTemplate="{value}%">
			<p:ajax event="complete"
					oncomplete="PF('processar').enable();PF('sair').enable();"/>
		</p:progressBar>
	</p:panel>	
</div>	
</ui:define>
<ui:define name="modal">
	
</ui:define>

</ui:composition>
</html>